/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pruebas;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author jsanchez
 */
public class Main {

    public Main() {
    }
    public static void main(String[] arg) throws ClassNotFoundException, SQLException{
        
        //System.out.println(System.getProperties().get("user.name"));
        // sun.tools.javac.Main m=new sun.tools.javac.Main(null,null);
        // j.k.l.ñ.z.x.c.v.b.n.m
        // 1.2.3.4.5.6.7.8.9.0

        /*String url="jdbc:jtds:sqlserver://192.168.0.37:1433/metricadb";
        String driver="net.sourceforge.jtds.jdbc.Driver";
        Class.forName(driver);
        Connection c=DriverManager.getConnection(url,"sa","");
        String QR="SELECT DISTINCT a.codorig AS CODORIG, a.codportaf AS CODPORTAF, D.codigotit AS CODIGOTIT, T .nombretit AS ESPECIE, M.nombre AS MONEDA, Po.Nombre AS PORTAFOLIO, E.Nombre AS EMISOR, E.codtercero AS CODTERCERO, D .Fecvencdoc AS FECHAVENCIMIENTO, D.FECCPRADOC AS FECHACOMPRA, Pa.FECHVTADOC AS FECHAVENTA, COMPRADA = CASE when D.fecCPRADOC > ? then 1 else 0 end , VENDIDA =case when pa.fechvtadoc <= ? then 1 else 0 end , ISNULL((Select Saldocap from valorac where codorig = A.codorig and codportaf = A.codportaf and fechaval = ?),0) AS VALORNOMINAL, D.NUMERODOC, D.FECEMISDOC AS FECHAEMISION, PA.PRECCPRDOC AS PRECIOCOMPRA, Pc.PRIMXAMOR*CASE A.CODMONEDA WHEN 0 THEN 1 ELSE ISNULL((SELECT N.VALMONEDA FROM NEGOCIOS N WHERE N.CODORIG=A.CODORIG),1) END AS PRIMATOTAL, Pc.DTOXAMOR*CASE A.CODMONEDA WHEN 0 THEN 1 ELSE ISNULL((SELECT N.VALMONEDA FROM NEGOCIOS N WHERE N.CODORIG=A.CODORIG),1) END AS DTOTOTAL, (SELECT TOP 1 LEFT(CODIGOTASA,5)+STR(TASAADIDOC,6,2) FROM DOCINT DI WHERE DI.CODORIG = A.CODORIG) AS TASAFACIAL, (SELECT TOP 1 PERIODICID+MODALIDAD FROM DOCINT DI WHERE DI.CODORIG = A.CODORIG) AS FORMADEPAGO, ISNULL((Select CLEAN*valmonVIG from valorac where codorig = A.codorig and codportaf = A.codportaf and fechaval = ?),0) as INTCAUS1, ISNULL((Select CLEAN*valmonVIG from valorac where codorig = A.codorig and codportaf = A.codportaf and fechaval = ?),0) as INTCAUS2, ISNULL((Select DESINGRES*valmonVIG from valorac where codorig = A.codorig and codportaf = A.codportaf and fechaval = ?),0) as DESCTO1, ISNULL((Select DESINGRES*valmonVIG from valorac where codorig = A.codorig and codportaf = A.codportaf and fechaval = ?),0) as DESCTO2, ISNULL((Select PRIMAGASTO*valmonVIG from valorac where codorig = A.codorig and codportaf = A.codportaf and fechaval = ?),0) as PRIMA1, ISNULL((Select PRIMAGASTO*valmonVIG from valorac where codorig = A.codorig and codportaf = A.codportaf and fechaval = ?),0) as PRIMA2, ISNULL((Select VALORLIN*valmonVIG from valorac where codorig = A.codorig and codportaf = A.codportaf and fechaval = ?),0) as VRLINEAL1, ISNULL((Select VALORLIN*valmonVIG from valorac where codorig = A.codorig and codportaf = A.codportaf and fechaval = ?),0) as VRLINEAL2, ISNULL((Select SUM(I1.VALOR*I1.valmonEDA) from INVPEND I1 where I1.CODIGODOC = A.codIGODOC and I1.codportaf = A.codportaf and I1.fecha<= ? AND I1.FECHA>?),0) as INTCOBRADO FROM (Valorac A INNER JOIN (Document D INNER JOIN (Titulos T INNER JOIN Monedas M ON T .codmoneda = M.codigo INNER JOIN Terceros E ON T .Emisor = E.Codtercero) ON D.codigotit = T .codigotit ) ON A.codorig = D.codorig) INNER JOIN Portafol Po ON A.codportaf = Po.Codportaf INNER JOIN PortGrup PG ON A.codportaf = PG.Codportaf INNER JOIN Partidas Pa ON Pa.Codigodoc = A.codorig INNER JOIN Posclasif Pc ON Pc.Codigodoc = A.codorig WHERE (A.FECHAVAL >= ?) AND (A.FECHAVAL <= ?) AND PG.Codgrupo = ? ORDER BY CODPORTAF,MONEDA,CODIGOTIT,CODORIG";
        QR="select period_name, ORGS.ORGS_ID, PRS.PRS_ID, PRS.PERSON, RO.RO_DESCRIPTION, PMG.GRD_ID, ACPS.D_AMOUNT, PRS.PRS_DATE_OF_JOIN, RGNO.REGISTRATION_NUMBER from vu_pma_persons prs left outer join pma_grade pmg on prs.prs_grd_sk = pmg.grd_sk, actual_payslip ACPS, pay_period pp, PMA_ORG_PERSON_ROLES OPR, PMA_ORGANIZATION_STRUCTURES ORGS, PMA_ROLES RO, E_D_TYPE EDT, PMA_NATURE_OF_JOBS NOJ, bp_business_partner bp, bp_registration_number RGNO, bp_registration_type RGT where bp.business_partner_sk = prs.prs_bpc_party_sk and ACPS.pay_period_sk = pp.pay_period_sk and ACPS.prs_sk = prs.prs_sk and OPR_PRS_SK = PRS.PRS_SK and OPR.OPR_ORGS_SK = ORGS.ORGS_SK and OPR.OPR_RO_SK = RO.RO_SK and ACPS.E_D_TYPE_SK = EDT.E_D_TYPE_SK and EDT.E_D_TYPE_CODE = 'CTDRD' and PRS.prs_noj_sk = NOJ.NOJ_SK AND RO.RO_IS_SALARIED ='Y' and OPR.OPR_PRIMARY_FLAG ='Y' and pp.pay_period_sk = 12 and rgno.business_partner_sk = bp.business_partner_sk AND RGT.REGISTRATION_TYPE = 'RD_NUMBER' AND RGT.REGISTRATION_TYPE_SK=RGNO.REGISTRATION_TYPE_SK and acps.arrear_flag = 'N' and ORGS.ORGS_IS_PAY_APPLICABLE='Y' order by PRS.PRS_ID";
        c.prepareStatement(QR);*/
    }

}
